<?
$username="eu_wilhelm";
$password="n3DN67xcDwPyba4S";
$database="eu_wilhelm";


mysql_connect("gis-db.uni-muenster.de",$username,$password) or die("Connection failed: ". mysql_error());

@mysql_select_db($database) or die( "Unable to select the database: ". mysql_error());

// id, sessionID, lat, lon, city, street, pub, cafe, bakery, weather, train, area, chapter, page, date
$storyLogger = "CREATE TABLE storyLogger(id int auto_increment, PRIMARY KEY(id),sessionID VARCHAR(50), lat DOUBLE, lon DOUBLE, city VARCHAR(50), street VARCHAR(50), pub VARCHAR(50), cafe VARCHAR(50), bakery VARCHAR(50), weather VARCHAR(50), train VARCHAR(50), area int(3) , chapter int(3), page int(3), created TIMESTAMP DEFAULT NOW());";

//id, sessionID, categorie, name, chapter, lat, lon, date
$poiLogger = "CREATE TABLE poiLogger(id int auto_increment, PRIMARY KEY(id), sessionID VARCHAR(50), categorie VARCHAR(50), name VARCHAR(50),chapter VARCHAR(50), lat DOUBLE, lon DOUBLE, created TIMESTAMP DEFAULT NOW());";

//id, sessionID, lat, lon, date
$positionLogger = "CREATE TABLE positionLogger(id int auto_increment, PRIMARY KEY(id), sessionID VARCHAR(50), lat DOUBLE, lon DOUBLE, accuracy DOUBLE, speed DOUBLE, created TIMESTAMP DEFAULT NOW());";

mysql_query($storyLogger) or die ("Query Error: " .mysql_error());
mysql_query($poiLogger) or die ("Query Error: " .mysql_error());
mysql_query($positionLogger) or die ("Query Error: " .mysql_error());


echo "Tables created";

mysql_close();

 
?>



